import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import '../../style/less/main.css';
import axios from '../../api/index';
import './address.css';
import {responts} from '../../assets/respons';
//import {Button ,mountNode } from 'antd';

class Address extends React.Component{
    constructor(){
        super();
        this.state = {
            currentCity:{},
            name:'黄冈'
        }
        
        
    }
    componentDidMount(){
        axios.api.currentCity().then((res)=>{
           this.setState({
               name:responts(res).name
           })
            this.setState({
                currentCity:responts(res)
            })
        });
    }
    render(){
      
        return(
          <div className='address'>
            <header className='head'>
                <div className='head-top'>
                    <div className='head-l'>eleme</div>
                    <div className='head-r'>
                        <span>登陆</span>
                        <span>|</span>
                        <span>注册</span>
                    </div>
                </div>
                <div className='head-m'>
                    <div className='left'>当前定位城市:</div>
                    <div className='right'>定位不准时，请在城市列表中选择</div>
                </div>
                <div className='head-b'>
                    <div className='left'>{this.state.currentCity.name}</div>
                    <div className='right'>></div>
                </div>
            </header>
           
          </div>
        )
    }
}

export default Address;